@echo off
chcp 65001 >nul
echo ========================================
echo Fitness登录注册功能测试脚本
echo ========================================

echo.
echo 正在测试登录注册API...

echo.
echo 1. 测试用户注册...
curl -X POST http://localhost:8080/api/user/signUp ^
  -H "Content-Type: application/json" ^
  -d "{\"username\":\"testuser\",\"password\":\"123456\",\"confirmPassword\":\"123456\"}"

echo.
echo.
echo 2. 测试用户登录...
curl -X POST http://localhost:8080/api/user/signIn ^
  -H "Content-Type: application/json" ^
  -d "{\"username\":\"testuser\",\"password\":\"123456\"}"

echo.
echo.
echo 3. 测试重复注册...
curl -X POST http://localhost:8080/api/user/signUp ^
  -H "Content-Type: application/json" ^
  -d "{\"username\":\"testuser\",\"password\":\"123456\",\"confirmPassword\":\"123456\"}"

echo.
echo.
echo 4. 测试错误密码登录...
curl -X POST http://localhost:8080/api/user/signIn ^
  -H "Content-Type: application/json" ^
  -d "{\"username\":\"testuser\",\"password\":\"wrongpassword\"}"

echo.
echo.
echo 测试完成！
echo 如果看到JSON响应，说明API正常工作
echo 如果看到连接错误，请确保应用正在运行
echo.
pause
